package com.qlk.odcinterface.dao.impl;

import com.qlk.common.dao.mybatis.BaseDao;
import com.qlk.odcinterface.dao.PmsChannelsDao;
import com.qlk.odcinterface.domain.PmsChannels;
import com.qlk.odcinterface.domain.query.PmsChannelsQuery;

import java.util.List;
import org.springframework.stereotype.Repository;

/**
 * PmsChannelsDAO实现类<br/>
 * 对'PMS渠道表'表进行基本的操作
 * 
 * @author zhaoyanan
 * @version 2016-4-14 13:22:58
 * 
 */
@Repository
public class PmsChannelsDaoImpl extends BaseDao implements PmsChannelsDao {
    /** namespace */
    private final String namespace = PmsChannelsDaoImpl.class.getName();
    
    /**
     * {@inheritDoc}
     */
    public List<PmsChannels> queryPmsChannelsList(PmsChannelsQuery queryBean) {
        return (List<PmsChannels>) queryForList(namespace +".queryPmsChannelsList", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public boolean insert(PmsChannels pmsChannels) {
        return insert(namespace +".insert", pmsChannels);
    }

    /**
     * {@inheritDoc}
     */
    public boolean update(PmsChannels pmsChannels) {
        return update(namespace +".update", pmsChannels);
    }

    /**
     * {@inheritDoc}
     */
    public int queryPmsChannelsCount(PmsChannelsQuery queryBean) {
        return (Integer) queryForObject(namespace +".queryPmsChannelsCount", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public List<PmsChannels> queryPmsChannelsListWithPage(PmsChannelsQuery queryBean) {
        return (List<PmsChannels>) queryForList(namespace +".queryPmsChannelsListWithPage", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public boolean delete(PmsChannels configuration) {
        return delete(namespace +".delete", configuration);
    }

    /**
     * {@inheritDoc}
     */
    public PmsChannels getPmsChannelsById(Integer id) {
        return (PmsChannels) queryForObject(namespace +".getPmsChannelsById", id);
    } 
    
    /**
     * {@inheritDoc}
     */
    public boolean exist(PmsChannels pmsChannels) {
        int count = (Integer) queryForObject(namespace +".exist", pmsChannels);
        return count > 0;
    }
}
